﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Calculations
{
	public struct SnapShot
	{
		/// <summary>
		/// Initializes a new instance of the SnapShot structure.
		/// </summary>
		/// <param name="wood"></param>
		/// <param name="clay"></param>
		/// <param name="crop"></param>
		/// <param name="iron"></param>
		public SnapShot(int wood, int clay, int crop, int iron)
		{
			_wood = wood;
			_clay = clay;
			_crop = crop;
			_iron = iron;
		}

		private int _wood;
		public int Wood
		{
			get
			{
				return _wood;
			}
		}

		private int _clay;
		public int Clay
		{
			get
			{
				return _clay;
			}
		}

		private int _crop;
		public int Crop
		{
			get
			{
				return _crop;
			}
		}

		private int _iron;
		public int Iron
		{
			get
			{
				return _iron;
			}
		}

		public SnapShot Increment(ICalculationModel calculationModel)
		{
			return new SnapShot(_wood + calculationModel.WoodRate,
				_clay + calculationModel.ClayRate,
				_crop + calculationModel.CropRate,
				_iron + calculationModel.IronRate);
		}

		public override string ToString()
		{
			return String.Format("Wood\t{0}\tClay\t{1}\tCrop\t{2}\tIron\t{3}", _wood, _clay, _crop, _iron);
		}
	}
}
